****Replication file for article in Environmental Politics
*Lena Maria Schaffer 14.07.2023

*Data set and code to replicate tables and figures (3-6) within the following article:
*Lena Maria Schaffer 
*"Who's Afraid of more Ambitious Climate Policy? How Distributional Implications shape Policy Support and Compensatory Preferences"
*Environmental Politics.
****
** Load data set
set more off
use "Data_EnvironmentalPolitics_Final.dta", clear

**** DV dichotom 1
generate DV01_co2law =. 
replace DV01_co2law = 0 if inlist(co2_law,1,2,3)
replace DV01_co2law = 1 if inlist(co2_law,4,5)

*** label variables
label var age "Age"
label var gender "Female"
label var polit_interest "Interest in Politics"
label var clim_concern "Climate concern"
label var left_right "Left-right Placement"
label var EDU_LMH "Education"
*** DVs:
label var co2_law "Support \coo law"
label var DV01_co2law "Support \coo law (0/1)"
label var DV_exp2_schwach "Redistribute to poor"
label var DV_exp2_umverteil "Redistribute to tenants"
label var DV2_exp2_schwach "Redistribute to poor (0/1)"
label var DV2_exp2_umverteil "Redistribute to tenants (0/1)"

*** Treatment Groups.
label variable con_impl_con "control"
label variable neg_distrib "Group losing"
label variable pos_distrib "Group winning"

***************************
gen varname1=3 if pos_distrib==1
	replace varname1=2 if neg_distrib==1
	replace varname1=1 if con_impl_con==1
	
	

	sort  varname1

	#delimit;
	label define varlab1 3 "Group winning" 2 "Group losing" 1 "Control" 
	;
	#delimit cr
	label values varname1 varlab1


graph set window fontface "Garamond"

*************.   Figure 3: Average effect of distributional information about groups potentially positively ("Information: Group winning") or negatively ("Information: Group losing") affected on respondents' support for revision of the CO2 law (compared to the control group). 

*******************************ANALYSIS AVERAGE MARGINAL EFFECTS *************************
*** Average marginal effects for the different groups (overall)
quietly eststo M1: reg co2_law i.pos_distrib i.neg_distrib 
quietly eststo M2: reg co2_law i.neg_distrib i.pos_distrib age gender polit_interest clim_concern left_right EDU_LMH

coefplot M1 M2, drop(_cons age gender polit_interest clim_concern left_right EDU_LMH )xline(0) scheme(plotplain)
graph save "Figure_3.gph", replace
*_Differences in labels are due to changes in Graph Editor


***Full table of results (Appendix)
*Table A1 Appendix (tex)
esttab M1 M2  using "TableA1.tex", replace  t(2) b(2) scalars("rmse s.e. of estimate") compress nogaps star(* 0.10 ** 0.05 *** 0.01) nobaselevels label booktabs ///
mgroups(" \cotwo law" , pattern(1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))  
*Table A1 Appendix (rtf) 
esttab M1 M2  using "TableA1.rtf", replace  t(2) b(2) scalars("rmse s.e. of estimate") compress obslast nogaps star(* 0.10 ** 0.05 *** 0.01) nobaselevels label

*************   Figure 4: Average effect of distributional information on support for revision of the CO2 law conditioned on respondents differentiated into winners (homeowner/"Individual winner") and losers (tenant/"Individual loser"). 

******* **************** Heterogenous treatment effects: Depending on individual self-interest ******************************
****
*** Average marginal effects for the different groups (overall)
quietly eststo Indiv_winner: reg co2_law i.pos_distrib i.neg_distrib  if winner_law==1
quietly eststo Indiv_loser: reg co2_law  i.pos_distrib i.neg_distrib if winner_law==0
quietly eststo Indiv_winner: reg co2_law  i.pos_distrib i.neg_distrib if winner_law==1
quietly eststo Indiv_loser: reg co2_law i.pos_distrib i.neg_distrib  if winner_law==0

coefplot Indiv_winner Indiv_loser, drop(_cons)xline(0) scheme(plotplain)

graph save "Figure_4.gph", replace
*_Differences in labels are due to changes in Graph Editor


**************.  Figure 5: Average effect of distributional information about groups potentially positively ("Group winning ") or negatively ("Group losing") affected on individual support/opposition with statements a) Personally, I would support using revenue from the CO2 levy to help poor households through redistribution ("Redistribute to poor"), and b) Personally, I would support using revenue from the CO2 tax to help tenants through redistribution ("Redistribute to tenants").

************************************ Different Outcome Var: Preferences toward redistribution *************************

*******************************ANALYSIS AVERAGE MARGINAL EFFECTS *************************
**1) General redistriubtion (poor)
eststo ame_poor: reg DV_exp2_schwach i.pos_distrib  i.neg_distrib 
**2) targeted redistribution (tenants)
eststo ame_tenant: reg DV_exp2_umverteil i.pos_distrib  i.neg_distrib 
*** Figure 5
coefplot ame_poor ame_tenant, drop(_cons ) xline(0) scheme(plotplain)
graph save "Figure_5.gph", replace
*_Differences in labels are due to changes in Graph Editor


***** Appendix table A3 (with control variables)
eststo ame_poor2: reg DV_exp2_schwach i.pos_distrib  i.neg_distrib age gender polit_interest clim_concern left_right EDU_LMH
eststo ame_tenant2: reg DV_exp2_umverteil i.pos_distrib  i.neg_distrib age gender polit_interest clim_concern left_right EDU_LMH

esttab ame_poor ame_poor2 ame_tenant ame_tenant2 using "TableA3.rtf", replace scalars("rmse s.e. of estimate" ) compress obslast b(2) t(2) nogaps star(* 0.10 ** 0.05 *** 0.01) nobaselevels label


************* Figure 6: Average effect of distributional information about groups on agreement with statements on a) support to redistribute revenue to poor, and b) support to redistribute revenue to tenants, conditioned by respondents' status as homeowner ("winner") or tenant ("loser").


****** **************** Heterogenous treatment effects: Depending on individual self-interest ******************************
**** Depending on own status: homeowner (winner_law==1) or tenant (winner_law==0)
**1) General redistriubtion (poor)
eststo Redistr_poor_winner: reg DV_exp2_schwach i.pos_distrib  i.neg_distrib if winner_law==1 
eststo Redistr_poor_loser: reg DV_exp2_schwach i.pos_distrib  i.neg_distrib if winner_law==0
**2) targeted redistribution (tenants)
eststo Redistr_tenant_winner: reg DV_exp2_umverteil i.pos_distrib  i.neg_distrib  if winner_law==1 
eststo Redistr_tenant_loser: reg DV_exp2_umverteil i.pos_distrib  i.neg_distrib if winner_law==0

**** Figure 6 ******* 
coefplot Redistr_poor_winner Redistr_tenant_winner, drop(_cons) xline(0)  scheme(plotplain) title("Self-interest: Respondent belonging to winning group") 
graph save "fig_6_1.gph", replace
coefplot Redistr_poor_loser Redistr_tenant_loser, drop(_cons) xline(0) scheme(plotplain) title("Self-interest: Respondent belonging to losing group")
graph save "fig_6_2.gph", replace

graph combine "fig_6_1.gph" "fig_6_2.gph", rows(2) cols(1) xcommon scheme(plotplain)
graph save "Figure_6.gph", replace

********************************************************** END Figures/Tables Main Article. ***********************************************
****Alternative Visualizations Figure 6.

**** Using 10% level ******* 
coefplot Redistr_poor_winner Redistr_tenant_winner, drop(_cons) xline(0) levels(95 90) scheme(plotplain) title("Self-interest: Respondent belonging to winning group") 
graph save "fig_6_3.gph", replace
coefplot Redistr_poor_loser Redistr_tenant_loser, drop(_cons) xline(0) levels(95 90) scheme(plotplain) title("Self-interest: Respondent belonging to losing group")
graph save "fig_6_4.gph", replace

graph combine "fig_6_3.gph" "fig_6_4.gph", rows(2) cols(1) xcommon scheme(plotplain)
graph save "Figure_6_level9095.gph", replace

**** Using with control vars ******* 
**1) General redistriubtion (poor)
eststo CRedistr_poor_winner: reg DV_exp2_schwach i.pos_distrib  i.neg_distrib age gender polit_interest clim_concern left_right EDU_LMH if winner_law==1 
 eststo CRedistr_poor_loser: reg DV_exp2_schwach i.pos_distrib  i.neg_distrib age gender polit_interest clim_concern left_right EDU_LMH  if winner_law==0
**2) targeted redistribution (tenants)
eststo CRedistr_tenant_winner: reg DV_exp2_umverteil i.pos_distrib  i.neg_distrib age gender polit_interest clim_concern left_right EDU_LMH if winner_law==1 
eststo CRedistr_tenant_loser: reg DV_exp2_umverteil i.pos_distrib  i.neg_distrib age gender polit_interest clim_concern left_right EDU_LMH if winner_law==0

coefplot CRedistr_poor_winner CRedistr_tenant_winner, drop(_cons age gender polit_interest clim_concern left_right EDU_LMH) xline(0) levels(95 90) scheme(plotplain) title("Self-interest: Respondent belonging to winning group") 
graph save "fig_6_5.gph", replace
coefplot CRedistr_poor_loser CRedistr_tenant_loser, drop(_cons age gender polit_interest clim_concern left_right EDU_LMH) xline(0) levels(95 90) scheme(plotplain) title("Self-interest: Respondent belonging to losing group")
graph save "fig_6_6.gph", replace

graph combine "fig_6_5.gph" "fig_6_6.gph", rows(2) cols(1) xcommon scheme(plotplain)
graph save "Figure_6_wcontrols.gph", replace

esttab Redistr_poor_winner CRedistr_poor_winner Redistr_tenant_winner CRedistr_tenant_winner Redistr_poor_loser CRedistr_poor_loser Redistr_tenant_loser CRedistr_tenant_loser using "TableA9.rtf", replace scalars("rmse s.e. of estimate" ) compress obslast b(2) t(2) nogaps star(* 0.10 ** 0.05 *** 0.01) nobaselevels label


**********************************************************  REST APPENDIX.  ************************************************
**************************************** DESCRIPTIVES ***************************************

graph dot (mean) co2_law, over(varname1)  exclude0 marker(1, mcolor(black) msymbol(circle) mfcolor(gs3) mlcolor(black)) yline(3.39, lcolor(black)) title(Do you support the current revision of the CO{sub:2} law?) ytitle("Mean by treatment group") scheme(plotplain)
graph save "FigureA3.gph", replace

graph dot (mean) DV_exp2_schwach (mean) DV_exp2_umverteil, over(varname1) exclude0 marker(1, mcolor(black) msymbol(circle) mfcolor(gs3) mlcolor(black)) marker(2, mcolor(gs12) msymbol(diamond) mlcolor(black)) yline(2.75, lcolor(black)) yline(2.62,  lcolor(black))  legend(order( 1 "Personally support to redistribute rebate towards poor households" 2 "Personally support to redistribute rebate towards tenants" )position(6) span) scheme(plotplain)
graph save "FigureA4.gph", replace

*** EFFECTS DICHOTOMIZED Average marginal effects for the different groups (overall)
** use dichotomized var(DV01_co2law).
**********************************************************************************
eststo M3: logit DV01_co2law i.pos_distrib i.neg_distrib 
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") ytitle ("Pr(Support CO2 law)") derivlabels xlabel(,angle(45)) yline(0.5) name(effects1, replace)

eststo M4: logit DV01_co2law i.neg_distrib i.pos_distrib age gender polit_interest clim_concern left_right EDU_LMH
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") ytitle ("Pr(Support CO2 law)") derivlabels xlabel(,angle(45)) yline(0.5) name(effects2, replace)

*Tabelle A2 Appendix Logistic regression
esttab M3 M4 using "TableA2.rtf", replace scalars("ll log likelihood" ) compress obslast nogaps star(* 0.10 ** 0.05 *** 0.01) nobaselevels label

***For effects use dichotomized vars(DV2_exp2_schwach/DV2_exp2_umverteil).
eststo ame_poor2: logit DV2_exp2_schwach i.pos_distrib  i.neg_distrib 
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") derivlabels xlabel(,angle(45)) name(effects1, replace) title("Do you support or oppose redistributing to poor",size(med))

eststo ame_tenant2: logit DV2_exp2_umverteil i.pos_distrib  i.neg_distrib 
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") derivlabels xlabel(,angle(45)) name(effects1, replace) title("Do you support or oppose redistributing to tenants",size(med))

margins, dydx(neg_distrib) atmeans 

***For effects use dichotomized var (DV2_exp2_schwach/DV2_exp2_umverteil) by own status (winner=1/loser=0).
eststo ame_poor3: logit DV2_exp2_schwach i.pos_distrib  i.neg_distrib if winner_law==1
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") derivlabels xlabel(,angle(45)) name(effects_winpoor, replace) title("Do you support or oppose redistributing to poor",size(med))

eststo ame_poor4: logit DV2_exp2_schwach i.pos_distrib  i.neg_distrib if winner_law==0
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") derivlabels xlabel(,angle(45)) name(effects_lospoor, replace) title("Do you support or oppose redistributing to poor",size(med))
*****
eststo ame_tenant3: logit DV2_exp2_umverteil i.pos_distrib  i.neg_distrib if winner_law==1
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") derivlabels xlabel(,angle(45)) name(effects_winten, replace) title("Do you support or oppose redistributing to tenants",size(med))

eststo ame_tenant4: logit DV2_exp2_umverteil i.pos_distrib  i.neg_distrib if winner_law==0
margins, atmeans over(varname1)
marginsplot, scheme(plotplain) xtitle("Treatments") derivlabels xlabel(,angle(45)) name(effects_losten, replace) title("Do you support or oppose redistributing to tenants",size(med))

*Tabelle A5 Appendix
esttab ame_poor2 ame_tenant2 ame_poor3 ame_poor4 ame_tenant3 ame_tenant4 using "TableA5.rtf", replace scalars("ll log likelihood" ) compress obslast b(2) t(2) nogaps star(* 0.10 ** 0.05 *** 0.01) nobaselevels label


***TABELLE Appendix
esttab Redistr_poor_winner CRedistr_poor_winner Redistr_tenant_winner CRedistr_tenant_winner  Redistr_poor_loser CRedistr_poor_loser Redistr_tenant_loser CRedistr_tenant_loser  using "tableA4.rtf", replace  t(2) b(2) scalars("rmse s.e. of estimate") compress nogaps star(* 0.10 ** 0.05 *** 0.01) nobaselevels label 
*Table TEXT 


